Source
- Python stdlib code (
_collections_abc.py
)
Iterable
is more general- supports only
__iter__()
- supports only
Sequence
inheritsIterable
(indirectly viaCollection
)- is in addition
Reversible
(supports__reversed__
) Collection
inheritsSized
,Iterable
andContainer
- supports
__len__()
(fromSized
) - supports
__iter__()
(fromIterable
) - supports
__contains__()
(fromContainer
)
- supports
tuple
andstr
are two examples of concrete subclasses ofSequence
- is in addition